<template>
    <el-menu background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" style="height: 100vh;"
        default-active="/Home" :collapse="isCollapse" :collapse-transition="false" router ref="el0">
        <el-menu-item index="/Home"  >
            <i class="el-icon-s-home"></i>
            <span slot="title">首页</span>
        </el-menu-item>
        <el-menu-item index="/User"  :style="{display: dis0}">
            <i class="el-icon-s-flag"></i>
            <span slot="title">用户管理</span>
        </el-menu-item>
        <el-menu-item index="/Grad" :style="{display: dis1}">
            <i class="el-icon-ship"></i>
            <span slot="title">毕设管理</span>
        </el-menu-item>
        <el-menu-item index="/Scores" :style="{display: dis2}">
            <i class="el-icon-s-promotion"></i>
            <span slot="title">成绩管理</span>
        </el-menu-item>
        <el-menu-item index="/Register" :style="{display: dis3}">
            <i class="el-icon-lollipop"></i>
            <span slot="title">毕设登记</span>
        </el-menu-item>
        <el-menu-item index="/GradeS" :style="{display: dis4}">
            <i class="el-icon-potato-strips"></i>
            <span slot="title">成绩查询</span>
        </el-menu-item>
        <el-menu-item index="/AssessG" :style="{display: dis5}">
            <i class="el-icon-present"></i>
            <span slot="title">成绩评定</span>
        </el-menu-item>
        <!-- <el-menu-item :index="'/' + item.menuclick" v-for="(item, i) in menu" :key="i">
            <i :class="item.menuicon"></i>
            <span slot="title">{{ item.menuname }}</span>
        </el-menu-item> -->


    </el-menu>
</template>

<script>
export default {
    name: "Aside",
    data() {
        return {
            user: {},
            dis0: 'static',
            dis1: 'static',
            dis2: 'static',
            dis3: 'static',
            dis4: 'static',
            dis5: 'static'
        }
    },

    computed: {
        "menu": {
            get() {
                return this.$store.state.menu
            }
        }
    },
    props: {
        isCollapse: Boolean
    },
    methods: {
        init() {
            this.user = JSON.parse(sessionStorage.getItem('CurUser'))
        },
        change() {
            if (this.user.roleId === 0) {
                this.dis3 = 'none',
                this.dis4 = 'none',
                this.dis5 = 'none'
            } else if (this.user.roleId === 1) {
                this.dis0 = 'none',
                this.dis1 = 'none',
                this.dis2 = 'none',
                this.dis3 = 'none',
                this.dis4 = 'none'
            } else if (this.user.roleId === 2) {
                this.dis0 = 'none',
                this.dis1 = 'none',
                this.dis2 = 'none',
                this.dis5 = 'none'
 
            }
        }
    },
    created() {
        this.init()
        this.change()
    },


}


</script>

<style scoped>


</style>